home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #9 / Amiga Plus CD - 2004 - No. 09.iso / amigaplus / tools / dev_libs / feelin040718 / include / libraries / feelin.h < prev    next >
C/C++ Source or Header  |  2004-08-03  |  68KB  |  1,475 lines

  1. #ifndef FEELIN_H
  2. #define FEELIN_H
  3.  
  4. /*
  5. **    $VER: feelin.h 7.0 (2004/07/18)
  6. **
  7. **    feelin.library definitions
  8. **
  9. **    © 2001-2004 Olivier LAVIALE (gofromiel@numericable.fr)
  10. */
  11.  
  12. /// Module information
  13. #include    <exec/libraries.h>
  14. #include    <exec/semaphores.h>
  15. #include    <utility/hooks.h>
  16.  
  17. #include    <proto/feelin.h>
  18.  
  19. #define     TRUE -1L
  20. #define     ALL  -1L
  21. #define     FV_VERSION 7
  22.  
  23. /*
  24.    All constants follow these rules :
  25.  
  26.    FM_<method>          - General method, understood by all classes [NUM]
  27.    FM_<class>_<method>  - Class method                              [NUM,STR]
  28.    FA_<attrib>          - General attribute, known by many classes. [NUM]
  29.    FA_<class>_<attrib>  - Specific class attribute                  [NUM,STR]
  30.    FV_<class>_<value>   - Special attribute value                   [NUM]
  31.    FS_<name>            - Structure of arguments to a method        [SYS]
  32.    FP_<class>_<value>   - Preference, resolved on FM_Setup          [STR]
  33.  
  34.    FA_<attrib> definitions are followed by a comment [ISG] :
  35.       I : it's possible to specify this attribute at object creation time.
  36.       S : it's possible to change this attribute with F_Set().
  37.       G : it's possible to get this attribute with F_Get().
  38.  
  39.    FR_<class> = Registered class id (unsigned 24 bits)
  40.    FR_<class>_MTHD = First Method ID of <class>
  41.    FR_<class>_ATTR = First Attribute ID of <class>
  42.  
  43.    Ranges:
  44.  
  45.    $F0000000 - $FFFFFFFF is reserved for Feelin methods.
  46.    $8F000000 - $8FFFFFFF is reserved for Feelin attributes.
  47.  
  48.    $C0000000 - $CFFFFFFF is reserved for custom classes methods.
  49.    $8C000000 - $8CFFFFFF is reserved for custom classes attributes.
  50.  
  51.    $4D000000 - 4DFFFFFFF is reserved for Dynamic methods.
  52.    $41000000 - 41FFFFFFF is reserved for Dynamic attributes.
  53.  
  54.    Since v6 of feelin.library most classes use dynamic IDs instead of static
  55.    ones.  Dynamic  IDs  are  generated on the fly at run time, thus they are
  56.    different at each session and future proof. You should  have  a  look  at
  57.    Feelin_DEV.guide to learn more about this.
  58.  
  59. */
  60.  
  61. #define MTHD_BASE                               0xF0000000
  62. #define ATTR_BASE                               0x8F000000
  63.  
  64. #define FCCM_BASE                               0xC0000000
  65. #define FCCA_BASE                               0x8C000000
  66.  
  67. #define DYNA_MTHD                               0x4D000000 // 'M'000000
  68. #define DYNA_ATTR                               0x41000000 // 'A'000000
  69. //+
  70.  
  71. /// Macros:
  72. /// Macros / Drawing
  73. #define _FPen(fp)          SetAPen(rp,_pens[fp])
  74. #define _APen(p)           SetAPen(rp,p)
  75. #define _BPen(p)           SetBPen(rp,p)
  76. #define _DrMd(m)           SetDrMd(rp,m)
  77. #define _Plot(x1,y1)       WritePixel(rp,x1,y1)
  78. #define _Move(x,y)         Move(rp,x,y)
  79. #define _Draw(x,y)         Draw(rp,x,y)
  80. #define _Boxf(x1,y1,x2,y2) RectFill(rp,x1,y1,x2,y2)
  81. #define _Text(s,c)         Text(rp,s,c)
  82. //+
  83. /// Macros / Object Generation
  84. enum    {
  85.  
  86.         FV_MakeObj_Label = 1,                   // label:PTR TO CHAR, flags:LONG
  87.         FV_MakeObj_Button,                      // label:PTR TO CHAR
  88.         FV_MakeObj_Bar,                         // Horiz:BOOL
  89.         FV_MakeObj_BarTitle,                    // label:PTR TO CHAR
  90.         FV_MakeObj_Gauge,                       // Horiz:BOOl,LONG Min, LONG Max, LONG Value
  91.         FV_MakeObj_Slider,                      // Horiz:BOOl,LONG Min, LONG Max, LONG Value
  92.         FV_MakeObj_Prop,                        // Horiz:BOOl,LONG entries, LONG visible, LONG first
  93.         FV_MakeObj_String                       // label:PTR TO CHAR,maxlen:LONG
  94.  
  95.         };
  96.  
  97. #define SimpleButton(x)       F_MakeObj(FV_MakeObj_Button,x)
  98. #define Bar                   F_MakeObjA(FV_MakeObj_Bar,NULL)
  99. #define BarTitle(x)           F_MakeObj(FV_MakeObj_BarTitle,x)
  100. #define Gauge(h,mi,ma,v)      F_MakeObj(FV_MakeObj_Gauge,h,mi,ma,v)
  101. #define Prop(h,e,v,f)         F_MakeObj(FV_MakeObj_Prop,h,e,v,f)
  102. #define String(s,l)           F_MakeObj(FV_MakeObj_String,s,l)
  103. #define Slider(h,mi,ma,v)     F_MakeObj(FV_MakeObj_Slider,h,mi,ma,v,TAG_DONE)
  104. #define SliderA               F_MakeObj(FV_MakeObj_Slider
  105.  
  106. #define Child       FA_Child
  107. #define End         TAG_DONE)
  108. //+
  109. ///Macros / Userfull
  110. #ifdef _DCC
  111. #define REG(x) __ ## x
  112. #define ASM
  113. #define SAVEDS __geta4
  114. #else
  115. #define REG(x) register __ ## x
  116. #define ASM    __asm
  117. #define SAVEDS __saveds
  118. #endif
  119.  
  120. #define REG_D0  REG(d0)
  121. #define REG_D1  REG(d1)
  122. #define REG_D2  REG(d2)
  123. #define REG_D3  REG(d3)
  124. #define REG_D4  REG(d4)
  125. #define REG_D5  REG(d5)
  126. #define REG_D6  REG(d6)
  127. #define REG_D7  REG(d7)
  128.  
  129. #define REG_A0  REG(a0)
  130. #define REG_A1  REG(a1)
  131. #define REG_A2  REG(a2)
  132. #define REG_A3  REG(a3)
  133. #define REG_A4  REG(a4)
  134. #define REG_A5  REG(a5)
  135. #define REG_A6  REG(a6)
  136. #define REG_A7  REG(a7)
  137.  
  138. #define MAKE_ID(a,b,c,d)            ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
  139. #define MIN(a,b)                    (((a)<(b))?(a):(b))
  140. #define MAX(a,b)                    (((a)>(b))?(a):(b))
  141. #define _inside(a,a1,a2)            ((a) >= (a1) && (a) <= (a2))
  142. //+
  143. //+
  144.  
  145. typedef void * FObject;
  146. typedef unsigned long (ASM *FHookEntry)(REG_A2 FObject Obj,REG_A1 APTR Msg);
  147.  
  148. ///Basic structures
  149. struct FeelinNode {
  150.     struct FeelinNode              *Next;
  151.     struct FeelinNode              *Prev;
  152. };
  153.  
  154. struct FeelinNodePri {
  155.     struct FeelinNodePri           *Next;
  156.     struct FeelinNodePri           *Prev;
  157. /* end of FeelinNode header */
  158.     BYTE                            Priority;
  159.     UBYTE                           reserved1;
  160. };
  161.  
  162. struct FeelinNodeNamed {
  163.     struct FeelinNodePri           *Next;
  164.     struct FeelinNodePri           *Prev;
  165.     BYTE                            Priority;
  166.     UBYTE                           reserved1;
  167. /* end of FeelinNodePri header */
  168.     UWORD                           reserved2;
  169.     STRPTR                          Name;
  170. };
  171.  
  172. struct FeelinList {
  173.     struct FeelinNode              *Head;
  174.     struct FeelinNode              *Tail;
  175. };
  176.  
  177. struct FeelinListSemaphored {
  178.     struct FeelinNode              *Head;
  179.     struct FeelinNode              *Tail;
  180. /* end of FeelinList header */
  181.     struct SignalSemaphore          Semaphore;
  182. };
  183.  
  184. struct FeelinNodeData {
  185.     struct FeelinNode              *Next;
  186.     struct FeelinNode              *Prev;
  187. /* end of FeelinNode header */
  188.     APTR                            Data;
  189. };
  190.  
  191. typedef struct FeelinHashLink       FHashLink;
  192. typedef struct FeelinHashTable      FHashTable;
  193.  
  194. struct FeelinHashLink
  195. {
  196.     FHashLink                      *Next;
  197.     UBYTE                          *Key;
  198.     ULONG                           KeyLength;
  199.     APTR                            Data;
  200. };
  201.  
  202. struct FeelinHashTable
  203. {
  204.    ULONG                            Size;
  205.    FHashLink                      **Entries;
  206. /* entries bellow */
  207. };
  208.  
  209. //+
  210.  
  211. struct FeelinBase
  212. {
  213.     struct Library                  Libnode;
  214.     BPTR                            Console;
  215.     APTR                            PutChar;
  216.  
  217.     struct ExecBase                *SYS;
  218.     struct DosLibrary              *DOS;
  219.     struct GfxBase                 *Graphics;
  220.     struct IntuitionBase           *Intuition;
  221.     struct Library                 *Utility;
  222.     struct Library                 *Layers;
  223.     struct Library                 *Locale;
  224. };
  225.  
  226. /***************************************************************************/
  227. /*** feelin.library ********************************************************/
  228. /***************************************************************************/
  229.  
  230. ///feelin.library / F_LogA
  231.  
  232. /* The user can choose from which error level F_LogA() is allowed to  write
  233. in the debug console. */
  234.  
  235. enum    {
  236.  
  237.         FV_ERLV_USER,
  238.  
  239.         /* This error level should only  be  used  for  major  errors  e.g.
  240.         application  cannot be created, window cannot be opened... The goal
  241.         of this error level is to  give  information  on  errors  that  may
  242.         confuse the user (not the developper) */
  243.  
  244.         FV_ERLV_DEV,
  245.  
  246.         /* This error level is for people writting custom  classes.  It  is
  247.         generaly used by external classes */
  248.  
  249.         FV_ERLV_CLASS,
  250.  
  251.         /* This error level is for feelin class management : class creation
  252.         and handle, dynamic system, object creation and handle... */
  253.  
  254.         FV_ERLV_CORE
  255.  
  256.         /* A very low-level error  only  used  for  memory  troubles  (e.g.
  257.         disposing  a  block  that  does  not  exists,  or memory allocation
  258.         failure), hash link errors (e.g. removing a non linked node)... */
  259.  
  260.         };
  261.  
  262. //+
  263.  
  264. /***************************************************************************/
  265. /*** Low-level Objects *****************************************************/
  266. /***************************************************************************/
  267.  
  268. ///FC_Object                            0x000000
  269. #define FR_Object                                 0x000000
  270. #define FR_Object_MTHD                          (MTHD_BASE | FR_Object)
  271. #define FR_Object_ATTR                          (ATTR_BASE | FR_Object)
  272. #define FC_Object                                "Object"
  273.  
  274. #define FM_New                                  (FR_Object_MTHD +  0)
  275. #define FM_Dispose                              (FR_Object_MTHD +  1)
  276. #define FM_Get                                  (FR_Object_MTHD +  2)
  277. #define FM_Set                                  (FR_Object_MTHD +  3)
  278. #define FM_Notify                               (FR_Object_MTHD +  4)
  279. #define FM_UnNotify                             (FR_Object_MTHD +  5)
  280. #define FM_CallHook                             (FR_Object_MTHD +  6)
  281. #define FM_CallHookEntry                        (FR_Object_MTHD +  7)
  282. #define FM_WriteLong                            (FR_Object_MTHD +  8)
  283. #define FM_WriteString                          (FR_Object_MTHD +  9)
  284. #define FM_MultiSet                             (FR_Object_MTHD + 10)
  285. #define FM_SetAsString                          (FR_Object_MTHD + 11)
  286. #define FM_Export                               (FR_Object_MTHD + 12) /* The Methods bellow are general methods */
  287. #define FM_Import                               (FR_Object_MTHD + 13)
  288. #define FM_Connect                              (FR_Object_MTHD + 14)
  289. #define FM_Disconnect                           (FR_Object_MTHD + 15)
  290. #define FM_AddMember                            (FR_Object_MTHD + 16)
  291. #define FM_RemMember                            (FR_Object_MTHD + 17)
  292.  
  293. typedef void                                    FNotifyHandler;
  294.  
  295. struct  FS_Notify                               { ULONG Attribute; ULONG Value; FObject Target; ULONG Method; ULONG Count; /*...*/ };
  296. struct  FS_UnNotify                             { FNotifyHandler *Handler; };
  297. struct  FS_CallHook                             { struct Hook *Hook; /*...*/ };
  298. struct  FS_CallHookEntry                        { FHookEntry Entry; /*...*/ };
  299. struct  FS_Export                               { FObject Dataspace; ULONG id_Add;  };
  300. struct  FS_Import                               { FObject Dataspace; ULONG id_Find; };
  301. struct  FS_Connect                              { FObject Parent; };
  302. struct  FS_AddMember                            { FObject Object; ULONG Position; FObject Previous; };
  303. struct  FS_RemMember                            { FObject Member; };
  304.  
  305. #define FA_Class                                (FR_Object_ATTR +  0)   // [..G]
  306. #define FA_Revision                             (FR_Object_ATTR +  1)   // [..G]
  307. #define FA_Version                              (FR_Object_ATTR +  2)   // [..G]
  308. #define FA_ID                                   (FR_Object_ATTR +  3)   // [I.G] - Altought defined here, this attribute *must* be handled by sub-classes
  309. #define FA_UserData                             (FR_Object_ATTR +  4)
  310. #define FA_NoNotify                             (FR_Object_ATTR +  5)
  311. #define FA_Parent                               (FR_Object_ATTR +  6)
  312. #define FA_Child                                (FR_Object_ATTR +  7)
  313. #define FA_ContextHelp                          (FR_Object_ATTR +  8)
  314. #define FA_ContextMenu                          (FR_Object_ATTR +  9)
  315.  
  316. enum    {
  317.  
  318.         FV_Notify_None,
  319.         FV_Notify_Self,
  320.         FV_Notify_Parent,
  321.         FV_Notify_Window,
  322.         FV_Notify_Application
  323.  
  324.         };
  325.  
  326. #define FV_Notify_Always                        0x49893131
  327. #define FV_Notify_Toggle                        0x49893132
  328. #define FV_Notify_Value                         0x49893131
  329.  
  330. enum    {
  331.  
  332.         FV_AddMember_Head = -1,
  333.         FV_AddMember_Tail,
  334.         FV_AddMember_Insert
  335.  
  336.         };
  337.  
  338. #define _class(o)                               ((struct FeelinClass *)(((ULONG *)(o))[-1]))
  339. #define _classname(o)                           (_class(o) -> Name)
  340. //+
  341. ///FC_Class                             0x000040
  342. #define FR_Class                                  0x000040
  343. #define FR_Class_MTHD                           (MTHD_BASE | FR_Class)
  344. #define FR_Class_ATTR                           (ATTR_BASE | FR_Class)
  345. #define FC_Class                                 "Class"
  346.  
  347. #define FA_Class_Name                           (FR_Class_ATTR +  0) // META
  348. #define FA_Class_Super                          (FR_Class_ATTR +  1)
  349. #define FA_Class_LODSize                        (FR_Class_ATTR +  2)
  350. #define FA_Class_Dispatcher                     (FR_Class_ATTR +  3)
  351. #define FA_Class_Init                           (FR_Class_ATTR +  4) // META
  352. #define FA_Class_Exit                           (FR_Class_ATTR +  5) // META
  353. #define FA_Class_UserData                       (FR_Class_ATTR +  6) // META
  354. #define FA_Class_Pool                           (FR_Class_ATTR +  7) // META
  355. #define FA_Class_Methods                        (FR_Class_ATTR +  8)
  356. #define FA_Class_Attributes                     (FR_Class_ATTR +  9)
  357. #define FA_Class_ResolveTable                   (FR_Class_ATTR + 10) // META
  358. #define FA_Class_MethodsTable                   (FR_Class_ATTR + 11)
  359. #define FA_Class_AutoResolveTable               (FR_Class_ATTR + 12) // META
  360. #define FA_Class_CatalogName                    (FR_Class_ATTR + 13) // META
  361. #define FA_Class_CatalogTable                   (FR_Class_ATTR + 14) // META
  362.  
  363. /*
  364.  
  365. Currently, external class have only one function FCC_Query(). This function
  366. is  called  to  obtain information on the class e.g. tag items to build the
  367. class, or tag items to build a PreferenceGroup to modify preferences...
  368.  
  369. F_QUERY()
  370. {
  371.     switch (Which)
  372.     {
  373.         case FV_Query_ClassTags:
  374.         {
  375.             return ClassTags;
  376.         }
  377.         case FV_Query_PrefsTags:
  378.         {
  379.             return PrefsTags;
  380.         }
  381.     }
  382.     return NULL;
  383. }
  384.  
  385. */
  386.  
  387. enum    {
  388.  
  389.         FV_Query_ClassTags = 1,
  390.         FV_Query_PrefsTags
  391.  
  392.         };
  393.  
  394. typedef struct FeelinClass          FClass;
  395. typedef struct FeelinMethodEntry    FMethodEntry;
  396. typedef struct FeelinDynamicEntry   FDynamicEntry;
  397. typedef struct FeelinCatalogEntry   FCatalogEntry;
  398.  
  399. struct FeelinDynamicEntry
  400. {
  401.     STRPTR                          Name;
  402.     ULONG                           ID;
  403. };
  404.  
  405. struct FeelinClass
  406. {
  407.     struct FeelinClass             *Next;
  408.     struct FeelinClass             *Prev;
  409. // end of FeelinNode header -> FIXME: embended nodes will disapear in the future
  410.     STRPTR                          Name;
  411.     UWORD                           Offset;
  412.     UWORD                           LODSize;
  413.     APTR                            UserData;
  414.     ULONG                           UserCount;
  415.  
  416.     struct FeelinClass             *Super;
  417.     struct FeelinDynamicEntry      *Methods;            // see FA_Class_Methods
  418.     struct FeelinDynamicEntry      *Attributes;         // see FA_Class_Attributes
  419.     struct FeelinDynamicEntry      *ResolvedIDs;        // see FA_Class_ResolveTable
  420.     struct FeelinDynamicEntry      *AutoResolvedIDs;    // see FA_Class_AutoResolveTable
  421. };
  422.  
  423. typedef unsigned long (ASM *FMethod)(REG_A2 struct FeelinClass *Class,REG_A0 FObject Obj,REG_D0 ULONG Method,REG_A1 APTR Msg);
  424. typedef unsigned long (ASM *FClassInit)(REG_A2 struct FeelinClass *Class);
  425. typedef unsigned long (ASM *FClassExit)(REG_A2 struct FeelinClass *Class);
  426.  
  427. struct FeelinMethodEntry
  428. {
  429.     FMethod                         Method;
  430.     STRPTR                          Name;
  431.     ULONG                           ID;
  432. };
  433.  
  434. struct FeelinCatalogEntry
  435. {
  436.     ULONG                           ID;
  437.     STRPTR                          String;
  438.     STRPTR                          Default;
  439. };
  440.  
  441. /*** Macros ***/
  442.  
  443. #define F_QUERY()               SAVEDS ASM struct TagItem * FCC_Query(REG_D0 ULONG Which,REG_A0 struct FeelinBase *Feelin)
  444. #define F_INIT()                SAVEDS ASM BOOL             FCC_Init(REG_A2 struct FeelinClass *Class)
  445. #define F_EXIT()                SAVEDS ASM void             FCC_Exit(REG_A2 struct FeelinClass *Class)
  446. #define F_METHOD(rc,name)       SAVEDS ASM rc    name(REG_A2 struct FeelinClass *Class,REG_A0 FObject Obj,REG_D0 ULONG Method,REG_A1 APTR Msg)
  447. #define F_METHODM(rc,name,fs)   SAVEDS ASM rc    name(REG_A2 struct FeelinClass *Class,REG_A0 FObject Obj,REG_D0 ULONG Method,REG_A1 struct fs *Msg)
  448. #define F_HOOK(rc,name)         SAVEDS ASM rc    name(REG_A0 struct Hook *Hook,REG_A2 FObject Obj,REG_A1 APTR Msg)
  449. #define F_HOOKH(rc,name,hs)     SAVEDS ASM rc    name(REG_A0 struct hs *Hook,REG_A2 FObject Obj,REG_A1 APTR Msg)
  450. #define F_HOOKM(rc,name,fs)     SAVEDS ASM rc    name(REG_A0 struct Hook *Hook,REG_A2 FObject Obj,REG_A1 struct fs *Msg)
  451. #define F_HOOKHM(rc,name,hs,fs) SAVEDS ASM rc    name(REG_A0 struct hs *Hook,REG_A2 FObject Obj,REG_A1 struct fs *Msg)
  452. #define F_SUPERDO()             F_SuperDoA(Class,Obj,Method,Msg)
  453. #define F_OBJDO(o)              F_DoA(o,Method,Msg)
  454. #define F_STORE(val)            *((ULONG *)(item.ti_Data)) = (ULONG)(val) /* Only for Classes using F_DynamicNTI() */
  455. #define F_LOD(cl,o)             ((APTR)((ULONG)(o) + cl -> Offset))      /* Used by within classes to get LocalObjectData */
  456. #define F_ID(tab,n)             (tab[n].ID)
  457. #define F_IDM(n)                F_ID(Class -> Methods,n)
  458. #define F_IDA(n)                F_ID(Class -> Attributes,n)
  459. #define F_IDR(n)                F_ID(Class -> ResolvedIDs,n)
  460. #define F_IDO(n)                F_ID(Class -> AutoResolvedIDs,n)
  461. #define F_CAT(n)                (FCC_CatalogTable[CAT_ ## n].String)
  462. //+
  463. ///FC_Semaphore                         0x000080
  464. #define FR_Semaphore                            0x000080
  465. #define FR_Semaphore_MTHD                       (MTHD_BASE | FR_Semaphore)
  466. #define FR_Semaphore_ATTR                       (ATTR_BASE | FR_Semaphore)
  467. #define FC_Semaphore                            "Semaphore"
  468.  
  469. #define FM_Semaphore_Lock                       (FR_Semaphore_MTHD + 0)
  470. #define FM_Semaphore_Unlock                     (FR_Semaphore_MTHD + 1)
  471.  
  472. #define FA_Semaphore_Name                       (FR_Semaphore_ATTR + 0)
  473. #define FA_Semaphore_Public                     (FR_Semaphore_ATTR + 1)
  474.  
  475. #define FF_Semaphore_Exclusive                  (0)
  476. #define FF_Semaphore_Shared                     (1L << 0)
  477. #define FF_Semaphore_Attempt                    (1L << 1)
  478. //+
  479. ///FC_Server                            0x0000C0
  480. #define FR_Server                                 0x0000C0
  481. #define FR_Server_MTHD                          (MTHD_BASE | FR_Server)
  482. #define FR_Server_ATTR                          (ATTR_BASE | FR_Server)
  483. #define FC_Server                                "Server"
  484.  
  485. #define FM_Server_Find                          (FR_Server_MTHD +  0)
  486. #define FM_Server_Open                          (FR_Server_MTHD +  1)
  487. #define FM_Server_Close                         (FR_Server_MTHD +  2)
  488. #define FM_Server_Create                        (FR_Server_MTHD +  3)
  489. #define FM_Server_Delete                        (FR_Server_MTHD +  4)
  490. #define FM_Server_Shutdown                      (FR_Server_MTHD +  5)
  491.  
  492. #define FA_Server_Port                          (FR_Server_ATTR +  0) // [..G]
  493. #define FA_Server_Entry                         (FR_Server_ATTR +  1) // [I..]
  494. #define FA_Server_StackSize                     (FR_Server_ATTR +  3) // [I..]
  495. #define FA_Server_Priority                      (FR_Server_ATTR +  4) // [I..]
  496. #define FA_Server_Node                          (FR_Server_ATTR +  5) // [..G] PRIVATE
  497. #define FA_Server_Name                          FA_Semaphore_Name
  498.  
  499. struct FeelinServerMessage
  500. {
  501.     struct Node                     mn_Node;
  502.     struct MsgPort                 *mn_ReplyPort;
  503.     UWORD                           mn_Length;
  504. /* end of Message Header */
  505.     UWORD                           pad0;
  506.     ULONG                           Method;
  507.     APTR                            Msg;
  508.     ULONG                           Return;
  509. };
  510. //+
  511.  
  512. /***************************************************************************/
  513. /*** Support ***************************************************************/
  514. /***************************************************************************/
  515.  
  516. ///FC_Render                            0x900000
  517. #define FR_Render                                 0x900000
  518. #define FR_Render_MTHD                          (MTHD_BASE | FR_Render)
  519. #define FR_Render_ATTR                          (ATTR_BASE | FR_Render)
  520. #define FC_Render                                              "Render"
  521.  
  522. #define FA_Render_Application                   (FR_Render_ATTR +  0) // [I..] APTR - MUST be defined on creation time
  523. #define FA_Render_Display                       (FR_Render_ATTR +  1) // [I..] APTR - MUST be defined on creation time
  524. #define FA_Render_Window                        (FR_Render_ATTR +  2)
  525. #define FA_Render_RPort                         (FR_Render_ATTR +  3)
  526. #define FA_Render_Palette                       (FR_Render_ATTR +  4)
  527. #define FA_Render_Friend                        (FR_Render_ATTR +  5) // [I..]
  528. #define FA_Render_Forbid                        (FR_Render_ATTR +  6)
  529.  
  530. #define FM_Render_AddClip                       (FR_Render_MTHD +  0)
  531. #define FM_Render_RemClip                       (FR_Render_MTHD +  1)
  532. #define FM_Render_AddClipRegion                 (FR_Render_MTHD +  2)
  533. struct  FS_Render_AddClip                       { struct FeelinRect *Rect; };
  534. struct  FS_Render_RemClip                       { APTR Handle; };
  535. struct  FS_Render_AddClipRegion                 { struct Region *Region; };
  536.  
  537. struct FeelinRender
  538. {
  539.     FObject                         Application;        // Valid between FM_Setup / FM_Cleanup
  540.     FObject                         Display;
  541.     FObject                         Window;             // Valid between FM_Setup / FM_Cleanup
  542.     struct RastPort                *RPort;              // Valid between FM_Show  / FM_Hide
  543.     struct FeelinPalette           *Palette;            // Set at will
  544.     ULONG                           Flags;
  545. /*  private data below */
  546. };
  547.  
  548. typedef struct FeelinRender                     FRender;
  549.  
  550. #define FF_Render_Refreshing                    (1L <<  0) // Refeshing window
  551. #define FF_Render_Complex                       (1L <<  1) // complex refresh requested
  552. #define FF_Render_TrueColors                    (1L << 30) // Display Context is Hi-Color (>=15) or True-Color space
  553. #define FF_Render_Forbid                        (1L << 31) // Forbid F_Draw()
  554. //+
  555. ///FC_Family                            0x900040
  556. #define FR_Family                                 0x900040
  557. #define FR_Family_MTHD                          (MTHD_BASE | FR_Family)
  558. #define FR_Family_ATTR                          (ATTR_BASE | FR_Family)
  559. #define FC_Family                               "Family"
  560.  
  561. #define FA_Family                               (FR_Family_ATTR +  0)   // [..G] - General attribute
  562. #define FA_Family_Head                          (FR_Family_ATTR +  1)   // [..G]
  563. #define FA_Family_Tail                          (FR_Family_ATTR +  2)   // [..G]
  564. #define FA_Family_Owner                         (FR_Family_ATTR +  3)   // [I..]
  565.  
  566. struct FeelinFamilyNode
  567. {
  568.     struct FeelinFamilyNode                    *Next;
  569.     struct FeelinFamilyNode                    *Prev;
  570.     FObject                                     Object;
  571. };
  572.  
  573. typedef struct FeelinFamilyNode                 FFamilyNode;
  574. //+
  575. ///FC_FrameDisplay                      0x900080
  576. #define FR_FrameDisplay                           0x900080
  577. #define FR_FrameDisplay_MTHD                    (MTHD_BASE | FR_FrameDisplay)
  578. #define FR_FrameDisplay_ATTR                    (ATTR_BASE | FR_FrameDisplay)
  579. #define FC_FrameDisplay                         "FrameDisplay"
  580.  
  581. #define FM_FrameDisplay_Draw                    (FR_FrameDisplay_MTHD +  0)
  582. struct  FS_FrameDisplay_Draw                    { struct FeelinBox *Box; struct FeelinRender *Render; ULONG Flags; };
  583.  
  584. #define FA_Back                                 (FR_FrameDisplay_ATTR +  0)
  585. #define FA_Frame                                (FR_FrameDisplay_ATTR +  1)
  586. #define FA_Frame_Font                           (FR_FrameDisplay_ATTR +  2)
  587. #define FA_Frame_Title                          (FR_FrameDisplay_ATTR +  3)
  588. #define FA_Frame_PreParse                       (FR_FrameDisplay_ATTR +  4)
  589. #define FA_Frame_Position                       (FR_FrameDisplay_ATTR +  5)
  590. #define FA_Frame_AreaObject                     (FR_FrameDisplay_ATTR +  6) // PRIVATE
  591.  
  592. #define FV_Frame_None                           0L
  593. #define FV_Frame_LastBuiltin                    255//49
  594. enum {  FV_Frame_UpLeft,                        /* FA_Frame_Position */
  595.         FV_Frame_UpRight,
  596.         FV_Frame_UpCenter,
  597.         FV_Frame_DownLeft,
  598.         FV_Frame_DownRight,
  599.         FV_Frame_DownCenter                     };
  600.  
  601. #define FF_Frame_Fill                           (1L << 00) // FM_FrameDisplay_Draw
  602. #define FF_Frame_Select                         (1L << 01) // FM_FrameDisplay_Draw
  603.  
  604. struct FeelinInner
  605. {
  606.     UBYTE                           l;
  607.     UBYTE                           t;
  608.     UBYTE                           r;
  609.     UBYTE                           b;
  610. };
  611.  
  612. typedef struct FeelinInner                      FInner;
  613.  
  614. struct FeelinFrameDisplay
  615. {
  616.     FInner                          Border[2];
  617.     FInner                          Space[2];
  618.     UWORD                           ID[2];
  619. //  end of public datas
  620. };
  621.  
  622. #define FrameDisplayObject                      F_NewObj(FC_FrameDisplay
  623. #define NoFrame                                 FA_Frame, FV_Frame_None
  624. #define ButtonFrame                             FA_Frame,"FP_Button_Frame"
  625. #define TextFrame                               FA_Frame,"FP_Text_Frame"
  626. #define StringFrame                             FA_Frame,"FP_String_Frame"
  627. #define PropFrame                               FA_Frame,"FP_Prop_Frame"
  628. #define SliderFrame                             FA_Frame,"FP_Slider_Frame"
  629. #define GaugeFrame                              FA_Frame,"FP_Gauge_Frame"
  630. #define GroupFrame                              FA_Frame,"FP_Group_Frame"
  631. //+
  632. ///FC_ImageDisplay                      0x9000C0
  633. #define FR_ImageDisplay                           0x9000C0
  634. #define FR_ImageDisplay_MTHD                    (MTHD_BASE | FR_ImageDisplay)
  635. #define FR_ImageDisplay_ATTR                    (ATTR_BASE | FR_ImageDisplay)
  636. #define FC_ImageDisplay                         "ImageDisplay"
  637.  
  638. #define FM_ImageDisplay_Setup                   (FR_ImageDisplay_MTHD + 0)
  639. #define FM_ImageDisplay_Cleanup                 (FR_ImageDisplay_MTHD + 1)
  640. #define FM_ImageDisplay_Draw                    (FR_ImageDisplay_MTHD + 2)
  641. #define FM_ImageDisplay_Size                    (FR_ImageDisplay_MTHD + 3)
  642. struct  FS_ImageDisplay_Setup                   { struct FeelinRender *Render; };
  643. struct  FS_ImageDisplay_Cleanup                 { struct FeelinRender *Render; };
  644. struct  FS_ImageDisplay_Draw                    { struct FeelinRender *Render; struct FeelinRect *Rect; ULONG Flags; };
  645. struct  FS_ImageDisplay_Size                    { ULONG Width, Height; ULONG Flags; };
  646. struct  FS_ImageDisplay_HookDraw                { struct FeelinRender *Render; struct FeelinRect *Rect; ULONG Flags; struct FeelinRect *Region; };
  647.  
  648. #define FA_ImageDisplay_Spec                    (FR_ImageDisplay_ATTR + 0)
  649. #define FA_ImageDisplay_State                   (FR_ImageDisplay_ATTR + 1)
  650. #define FA_ImageDisplay_Width                   (FR_ImageDisplay_ATTR + 2)
  651. #define FA_ImageDisplay_Height                  (FR_ImageDisplay_ATTR + 3)
  652.  
  653. #define FF_ImageDisplay_Region                  (1L << 0) /* FM_ImageDisplay_Draw flags - Indicate that Msg -> Rect is in fact a pointer to a struct Region (holding one or more rectangles) */
  654.  
  655. /* Builtin patterns */
  656.  
  657. enum {  FI_None,
  658.         FI_Shine,               FI_HalfShine,              FI_Fill,             FI_HalfShadow,             FI_Shadow,           FI_HalfDark,            FI_Dark,             FI_Highlight,
  659.         FI_Shine_HalfShine,     FI_HalfShine_Fill,         FI_Fill_HalfShadow,  FI_HalfShadow_Shadow,      FI_Shadow_HalfDark,  FI_HalfDark_Dark,       FI_Dark_Highlight,
  660.         FI_Shine_Fill,          FI_HalfShine_HalfShadow,   FI_Fill_Shadow,      FI_HalfShadow_HalfDark,    FI_Shadow_Dark,      FI_HalfDark_Highlight,
  661.         FI_Shine_HalfShadow,    FI_HalfShine_Shadow,       FI_Fill_HalfDark,    FI_HalfShadow_Dark,        FI_Shadow_Highlight,
  662.         FI_Shine_Shadow,        FI_HalfShine_HalfDark,     FI_Fill_Dark,        FI_HalfShadow_Highlight,
  663.         FI_Shine_HalfDark,      FI_HalfShine_Dark,         FI_Fill_Highlight,
  664.         FI_Shine_Dark,          FI_HalfShine_Highlight,
  665.         FI_Shine_Highlight                      };
  666.  
  667. #define ImageDisplayObject          F_NewObj(FC_ImageDisplay
  668. //+
  669. ///FC_TextDisplay                       0x900100
  670. #define FR_TextDisplay                            0x900100
  671. #define FR_TextDisplay_MTHD                     (MTHD_BASE | FR_TextDisplay)
  672. #define FR_TextDisplay_ATTR                     (ATTR_BASE | FR_TextDisplay)
  673. #define FC_TextDisplay                          "TextDisplay"
  674.  
  675. #define FM_TextDisplay_Setup                    (FR_TextDisplay_MTHD + 0)
  676. #define FM_TextDisplay_Cleanup                  (FR_TextDisplay_MTHD + 1)
  677. #define FM_TextDisplay_Draw                     (FR_TextDisplay_MTHD + 2)
  678. struct  FS_TextDisplay_Setup                    { FRender *Render; };
  679. struct  FS_TextDisplay_Draw                     { struct FeelinRect *Rect; ULONG Flags; };
  680.  
  681. #define FA_TextDisplay_Contents                 (FR_TextDisplay_ATTR +  0)
  682. #define FA_TextDisplay_PreParse                 (FR_TextDisplay_ATTR +  1)
  683. #define FA_TextDisplay_Font                     (FR_TextDisplay_ATTR +  2)
  684. #define FA_TextDisplay_Width                    (FR_TextDisplay_ATTR +  3)
  685. #define FA_TextDisplay_Height                   (FR_TextDisplay_ATTR +  4)
  686. #define FA_TextDisplay_Shortcut                 (FR_TextDisplay_ATTR +  5)
  687. //+
  688.  
  689. /***************************************************************************/
  690. /*** GUI System ************************************************************/
  691. /***************************************************************************/
  692.  
  693. ///Application                          0x004000
  694. #define FR_Application                            0x004000
  695. #define FR_Application_MTHD                     (MTHD_BASE | FR_Application)
  696. #define FR_Application_ATTR                     (ATTR_BASE | FR_Application)
  697. #define FC_Application                          "Application"
  698.  
  699. #define FM_Application_Run                      (FR_Application_MTHD +  0)
  700. #define FM_Application_Shutdown                 (FR_Application_MTHD +  1)
  701. #define FM_Application_Sleep                    (FR_Application_MTHD +  2) // PRIVATE
  702. #define FM_Application_Awake                    (FR_Application_MTHD +  3) // PRIVATE
  703. #define FM_Application_PushMethod               (FR_Application_MTHD +  4)
  704. #define FM_Application_Setup                    (FR_Application_MTHD +  5) // PRIVATE
  705. #define FM_Application_Cleanup                  (FR_Application_MTHD +  6) // PRIVATE
  706. #define FM_Application_Load                     (FR_Application_MTHD +  7)
  707. #define FM_Application_Save                     (FR_Application_MTHD +  8)
  708. #define FM_Application_Resolve                  (FR_Application_MTHD +  9)
  709. #define FM_Application_ResolveInt               (FR_Application_MTHD + 10)
  710. #define FM_Application_OpenFont                 (FR_Application_MTHD + 11)
  711. #define FM_Application_AddSignalHandler         (FR_Application_MTHD + 12)
  712. #define FM_Application_RemSignalHandler         (FR_Application_MTHD + 13)
  713. #define FM_Application_CollectSignals           (FR_Application_MTHD + 14) // STRICTLY PRIVATE
  714. #define FM_Application_NewPrefs                 (FR_Application_MTHD + 15) // PRIVATE
  715. #define FM_Application_OpenPrefs                (FR_Application_MTHD + 16) // PRIVATE
  716. #define FM_Application_ClosePrefs               (FR_Application_MTHD + 17) // PRIVATE
  717. struct  FS_Application_PushMethod               { FObject Target; ULONG Method ; ULONG Count; /*...*/ };
  718. struct  FS_Application_Load                     { STRPTR Name; };
  719. struct  FS_Application_Save                     { STRPTR Name; };
  720. struct  FS_Resolve                              { STRPTR Name; ULONG Default; };
  721. struct  FS_OpenFont                             { FObject Object; STRPTR Spec; };
  722. struct  FS_Application_AddSignalHandler         { struct FeelinSignalHandler *Handler; };
  723. struct  FS_Application_RemSignalHandler         { struct FeelinSignalHandler *Handler; };
  724.  
  725. #define FA_Application                          (FR_Application_ATTR +  0) // GENERAL
  726. #define FA_Application_Title                    (FR_Application_ATTR +  1) // [I..]
  727. #define FA_Application_Version                  (FR_Application_ATTR +  2) // [I..]
  728. #define FA_Application_Copyright                (FR_Application_ATTR +  3) // [I..]
  729. #define FA_Application_Author                   (FR_Application_ATTR +  4) // [I..]
  730. #define FA_Application_Description              (FR_Application_ATTR +  5) // [I..]
  731. #define FA_Application_Base                     (FR_Application_ATTR +  6) // [I..]
  732. #define FA_Application_Unique                   (FR_Application_ATTR +  7) // [I..]
  733. #define FA_Application_Signal                   (FR_Application_ATTR +  8)
  734. #define FA_Application_UserSignals              (FR_Application_ATTR +  9)
  735. #define FA_Application_WindowPort               (FR_Application_ATTR + 10) // [..G]
  736. #define FA_Application_BrokerPort               (FR_Application_ATTR + 11) // [..G]
  737. #define FA_Application_BrokerHook               (FR_Application_ATTR + 12) // [IS.]
  738. #define FA_Application_BrokerPri                (FR_Application_ATTR + 13) // [IS.]
  739. #define FA_Application_Broker                   (FR_Application_ATTR + 14)
  740. #define FA_Application_Display                  (FR_Application_ATTR + 15) // [..G]
  741. #define FA_Application_OBJSpace                 (FR_Application_ATTR + 16) // [..G]
  742. #define FA_Application_OBJPrefs                 (FR_Application_ATTR + 17)
  743. #define FA_Application_Sleep                    (FR_Application_ATTR + 18) // [ISG]
  744. #define FA_Application_State                    (FR_Application_ATTR + 19) // [..G]
  745.  
  746. enum {  FV_Application_ENV,
  747.         FV_Application_ENVARC,
  748.         FV_Application_BOTH                     };
  749.  
  750. enum {  FV_Application_Unknown,
  751.         FV_Application_Sleep,                      // All window closed (sleep mode)
  752.         FV_Application_Awake                    }; // Windows opened (awake mode)
  753.  
  754. enum {  FV_KEY_NONE,
  755.         FV_KEY_PRESS,
  756.         FV_KEY_RELEASE,
  757.         FV_KEY_UP,
  758.         FV_KEY_DOWN,
  759.         FV_KEY_STEPUP,
  760.         FV_KEY_STEPDOWN,
  761.         FV_KEY_TOP,
  762.         FV_KEY_BOTTOM,
  763.         FV_KEY_LEFT,
  764.         FV_KEY_RIGHT,
  765.         FV_KEY_STEPLEFT,
  766.         FV_KEY_STEPRIGHT,
  767.         FV_KEY_FIRST,
  768.         FV_KEY_LAST,
  769.         FV_KEY_CHARBACK,
  770.         FV_KEY_CHARDEL,
  771.         FV_KEY_WORDBACK,
  772.         FV_KEY_WORDDEL,
  773.         FV_KEY_LINEBACK,
  774.         FV_KEY_LINEDEL,
  775.         FV_KEY_NEXTOBJ,
  776.         FV_KEY_PREVOBJ,
  777.         FV_KEY_NOOBJ,
  778.         FV_KEY_CLOSEWINDOW,
  779.  
  780.         FV_KEY_COUNT                            };
  781.  
  782. #define ApplicationObject                       F_NewObj(FC_Application
  783. #define AppObject                               F_NewObj(FC_Application
  784.  
  785. /*** FeelinSignalHandler ***************************************************/
  786.  
  787. typedef struct FeelinSignalHandler              FSignalHandler;
  788.  
  789. struct FeelinSignalHandler
  790. {
  791.     struct  FeelinSignalHandler    *Next;
  792.     struct  FeelinSignalHandler    *Prev;
  793. /* end of FeelinNode header */
  794.     ULONG                           Flags;
  795.     struct  FeelinObject           *Object;
  796.     ULONG                           Method;
  797.  
  798.     union
  799.     {
  800.         struct
  801.         {
  802.             ULONG   Signals;
  803.             ULONG   Reserved;
  804.         } fsh_sig;
  805.  
  806.         struct
  807.         {
  808.             ULONG   Secs;
  809.             ULONG   Micros;
  810.         } fsh_timer;
  811.     } fsh_union;
  812. };
  813.  
  814. #define fsh_Signals                             fsh_union.fsh_sig.Signals
  815. #define fsh_Secs                                fsh_union.fsh_timer.Secs
  816. #define fsh_Micros                              fsh_union.fsh_timer.Micros
  817.  
  818. #define FF_SignalHandler_Timer                  (1L << 0)
  819.  
  820. /*** FeelinEvent ***********************************************************/
  821.  
  822. struct FeelinEvent
  823. {
  824.     struct IntuiMessage            *IMsg;           // Original IntuiMessage
  825.  
  826.     ULONG                           Flags;          // FF_Event_Xxx
  827.  
  828.     ULONG                           Class;
  829.     UWORD                           Code;
  830.     UWORD                           Qualifier;
  831.     UBYTE                           Key;            // depeding on user configurable short cuts.
  832.     UBYTE                           DecodedChar;    // If event is IDCMP_RAWKEY FC_Application will try to decode the event as a char.
  833.     UWORD                           reserved;
  834.  
  835.     WORD                            MouseX;
  836.     WORD                            MouseY;
  837.     ULONG                           Seconds;
  838.     ULONG                           Micros;
  839.  
  840.     APTR                            Window;         // WindowObject of the Event
  841. };
  842.  
  843. #define FF_Event_KeyUp                          (1L << 0) // IDCMP_RAWKEY - Key is up (released)
  844. #define FF_Event_Repeat                         (1L << 1) // IDCMP_RAWKEY - Key is held down
  845. #define FF_Event_DoubleClick                    (1L << 0) // IDCMP_MOUSEBUTTONS - Mouse double click - Although defined here, this flag is set by FC_Window
  846.  
  847. //+
  848. ///Window                               0x004040
  849. #define FR_Window                                 0x004040
  850. #define FR_Window_MTHD                          (MTHD_BASE | FR_Window)
  851. #define FR_Window_ATTR                          (ATTR_BASE | FR_Window)
  852. #define FC_Window                                "Window"
  853.  
  854. #define FM_Window_Setup                         (FR_Window_MTHD +  0)
  855. #define FM_Window_Cleanup                       (FR_Window_MTHD +  1)
  856. #define FM_Window_Open                          (FR_Window_MTHD +  2)
  857. #define FM_Window_Close                         (FR_Window_MTHD +  3)
  858. #define FM_Window_ChainAdd                      (FR_Window_MTHD +  4)
  859. #define FM_Window_ChainRem                      (FR_Window_MTHD +  5)
  860. #define FM_Window_AddEventHandler               (FR_Window_MTHD +  6)
  861. #define FM_Window_RemEventHandler               (FR_Window_MTHD +  7)
  862. #define FM_Window_HandleEvent                   (FR_Window_MTHD +  8)
  863. #define FM_Window_Layout                        (FR_Window_MTHD +  9)
  864. #define FM_Window_Draw                          (FR_Window_MTHD + 10)
  865. #define FM_Window_Zoom                          (FR_Window_MTHD + 11)
  866. #define FM_Window_Depth                         (FR_Window_MTHD + 12)
  867. #define FM_Window_ForEach                       (FR_Window_MTHD + 13)
  868. struct  FS_Window_ChainAdd                      { FObject Object; };
  869. struct  FS_Window_ChainRem                      { FObject Object; };
  870. struct  FS_Window_AddEventHandler               { struct FeelinEventHandler *Handler; };
  871. struct  FS_Window_RemEventHandler               { struct FeelinEventHandler *Handler; };
  872. struct  FS_Window_Zoom                          { ULONG Zoom; };
  873. struct  FS_Window_Depth                         { ULONG Depth; };
  874. //struct  FS_Window_ForEach                       { FWindow_EachFunc Func; APTR UserData; };
  875.  
  876. #define FA_Window                               (FR_Window_ATTR +  0)
  877. #define FA_Window_Title                         (FR_Window_ATTR +  1)
  878. #define FA_Window_ScreenTitle                   (FR_Window_ATTR +  2)
  879. #define FA_Window_Open                          (FR_Window_ATTR +  3)
  880. #define FA_Window_CloseRequest                  (FR_Window_ATTR +  4)
  881. #define FA_Window_Active                        (FR_Window_ATTR +  5)
  882. #define FA_Window_ActiveObject                  (FR_Window_ATTR +  6)
  883. #define FA_Window_Backdrop                      (FR_Window_ATTR +  7)
  884. #define FA_Window_Borderless                    (FR_Window_ATTR +  8)
  885. #define FA_Window_Resizable                     (FR_Window_ATTR +  9)
  886. #define FA_Window_GadNone                       (FR_Window_ATTR + 10)
  887. #define FA_Window_GadDragbar                    (FR_Window_ATTR + 11)
  888. #define FA_Window_GadClose                      (FR_Window_ATTR + 12)
  889. #define FA_Window_GadDepth                      (FR_Window_ATTR + 13)
  890. #define FA_Window_GadIconify                    (FR_Window_ATTR + 14)
  891. #define FA_Window_Decorator                     (FR_Window_ATTR + 15)
  892.  
  893. #define FA_Window_HandlePopHelp                 (FR_Window_ATTR + 16)
  894. //#define FA_Window_MouseObject                   (FR_Window_ATTR + 13)
  895.  
  896. enum    {
  897.  
  898.         FV_Window_ActiveObject_Prev             = -2,
  899.         FV_Window_ActiveObject_Next,
  900.         FV_Window_ActiveObject_None
  901.  
  902.         };
  903.  
  904. enum    {
  905.  
  906.         FV_Window_Zoom_Full                     = - 3,
  907.         FV_Window_Zoom_Max,
  908.         FV_Window_Zoom_Toggle
  909.  
  910.         };
  911.  
  912. enum    {
  913.  
  914.         FV_Window_Depth_Back                    = -3,
  915.         FV_Window_Depth_Front,
  916.         FV_Window_Depth_Toggle
  917.  
  918.         };
  919.  
  920. #define WindowObject                            F_NewObj(FC_Window
  921.  
  922. /***************************************************************************/
  923. /*** FeelinEventHandler ****************************************************/
  924. /***************************************************************************/
  925.  
  926. struct FeelinEventHandler
  927. {
  928.     struct FeelinEventHandler      *Next;
  929.     struct FeelinEventHandler      *Prev;
  930. /* end of FeelinNode header */
  931.     UWORD                           Flags;
  932.     BYTE                            Priority;       // Linked by priority
  933.     UBYTE                           reserved;
  934.     ULONG                           Events;         // One or more IDCMP flags this handler should react on
  935.     FObject                         Object;         // Object which should receive FM_HandleEvent
  936.     struct FeelinClass             *Class;          // If class <> NIL then class will be called instead of object.class
  937. };
  938.  
  939. #define FF_HandleEvent_Eat                      (1L << 00)
  940. //+
  941. ///Display                              0x004080
  942. #define FR_Display                               0x004080
  943. #define FR_Display_MTHD                         (MTHD_BASE | FR_Display)
  944. #define FR_Display_ATTR                         (ATTR_BASE | FR_Display)
  945. #define FC_Display                               "Display"
  946.  
  947. #define FM_AddColor                             (FR_Display_MTHD +  0)
  948. #define FM_RemColor                             (FR_Display_MTHD +  1)
  949. #define FM_AddPalette                           (FR_Display_MTHD +  2)
  950. #define FM_RemPalette                           (FR_Display_MTHD +  3)
  951. #define FM_CreateColor                          (FR_Display_MTHD +  4)
  952. #define FM_DeleteColor                          (FM_RemColor)
  953. #define FM_CreateColorScheme                    (FR_Display_MTHD +  5)
  954. #define FM_DeleteColorScheme                    (FM_RemPalette)
  955.  
  956. #define FA_ColorScheme                          (FR_Display_ATTR +  0)
  957.  
  958. enum    {
  959.  
  960.         FV_Pen_Text,         // 0
  961.         FV_Pen_Shine,        // 1
  962.         FV_Pen_HalfShine,    // 2
  963.         FV_Pen_Fill,         // 3
  964.         FV_Pen_HalfShadow,   // 4
  965.         FV_Pen_Shadow,       // 5
  966.         FV_Pen_HalfDark,     // 6
  967.         FV_Pen_Dark,         // 7
  968.         FV_Pen_Highlight,    // 8
  969.         FV_PEN_COUNT
  970.  
  971.         };
  972.  
  973. #define FV_COLOR_SPACE                          12
  974.  
  975. enum    {
  976.  
  977.         FV_Display_Frontmost = -2,
  978.         FV_Display_Workbench,
  979.         FV_Display_Public
  980.  
  981.         };                                      // FA_Display_Name
  982.  
  983. /*** TYPES *****************************************************************/
  984.  
  985. struct FeelinColor
  986. {
  987.     ULONG                           _priv0;
  988.     ULONG                           _priv1;
  989.     ULONG                           Pen;
  990.     ULONG                           ARGB;
  991. };
  992.  
  993. typedef struct FeelinColor                      FColor;
  994.  
  995. struct FeelinPalette
  996. {
  997.     ULONG                           _priv0;
  998.     ULONG                           _priv1;
  999.     ULONG                           _priv2;
  1000.     ULONG                           Count;
  1001.     ULONG                          *Pens;
  1002.     ULONG                          *ARGB;
  1003.     FColor                        **Colors;
  1004. };
  1005.  
  1006. typedef struct FeelinPalette                    FPalette;
  1007.  
  1008. /*** Method's structures ***/
  1009.  
  1010. struct  FS_AddColor                             { ULONG ARGB; };
  1011. struct  FS_RemColor                             { FColor *Color; };
  1012. struct  FS_AddPalette                           { ULONG Count; ULONG *ARGBs; };
  1013. struct  FS_RemPalette                           { FPalette *Palette; };
  1014. struct  FS_CreateColor                          { STRPTR Spec; FPalette *Reference; };
  1015. struct  FS_DeleteColor                          { FColor *Color; };
  1016. struct  FS_CreateColorScheme                    { STRPTR Spec; FPalette *Reference; };
  1017. struct  FS_DeleteColorScheme                    { FPalette *Palette; };
  1018. //+
  1019. /*** GUI Classes ***********************************************************/
  1020.  
  1021. ///Area                               0x001000
  1022. #define FR_Area                                   0x001000
  1023. #define FC_Area                                                "Area"
  1024. #define FR_Area_MTHD                            (MTHD_BASE | FR_Area)
  1025. #define FR_Area_ATTR                            (ATTR_BASE | FR_Area)
  1026.  
  1027. /*** methods ***************************************************************/
  1028.  
  1029. #define FM_Setup                                (FR_Area_MTHD +  0)
  1030. #define FM_Cleanup                              (FR_Area_MTHD +  1)
  1031. #define FM_Show                                 (FR_Area_MTHD +  2)
  1032. #define FM_Hide                                 (FR_Area_MTHD +  3)
  1033. #define FM_AskMinMax                            (FR_Area_MTHD +  4)
  1034. #define FM_Layout                               (FR_Area_MTHD +  5)
  1035. #define FM_Draw                                 (FR_Area_MTHD +  6)
  1036. #define FM_Erase                                (FR_Area_MTHD +  7)
  1037. #define FM_HandleEvent                          (FR_Area_MTHD +  8)
  1038. #define FM_ModifyHandler                        (FR_Area_MTHD +  9)
  1039. #define FM_GoActive                             (FR_Area_MTHD + 10)
  1040. #define FM_GoInactive                           (FR_Area_MTHD + 11)
  1041. #define FM_GoEnabled                            (FR_Area_MTHD + 12)
  1042. #define FM_GoDisabled                           (FR_Area_MTHD + 13)
  1043. #define FM_DnDDo                                (FR_Area_MTHD + 14)
  1044. #define FM_DnDQuery                             (FR_Area_MTHD + 15)
  1045. #define FM_DnDBegin                             (FR_Area_MTHD + 16)
  1046. #define FM_DnDFinish                            (FR_Area_MTHD + 17)
  1047. #define FM_DnDReport                            (FR_Area_MTHD + 18)
  1048. #define FM_DnDDrop                              (FR_Area_MTHD + 19)
  1049. #define FM_RethinkLayout                        (FR_Area_MTHD + 20)
  1050. #define FM_BuildContextMenu                     (FR_Area_MTHD + 21)
  1051. #define FM_BuildContextHelp                     (FR_Area_MTHD + 22)
  1052. struct  FS_Setup                                { struct FeelinRender *Render; };
  1053. struct  FS_Draw                                 { ULONG Flags; };
  1054. struct  FS_Erase                                { struct FeelinRect *Rect; ULONG Flags; };
  1055. struct  FS_HandleEvent                          { struct FeelinEvent *FEv; };
  1056. struct  FS_ModifyHandler                        { ULONG Add; ULONG Sub; };
  1057. struct  FS_DnDDo                                { LONG MouseX, MouseY; };
  1058. struct  FS_DnDQuery                             { LONG MouseX, MouseY; FObject *Source; struct FeelinBox *Box; };
  1059. struct  FS_DnDBegin                             { FObject *Source; };
  1060. struct  FS_DnDFinish                            { FObject *Source; };
  1061. struct  FS_DnDReport                            { LONG MouseX, MouseY; FObject *Source; ULONG Update; struct FeelinBox *DragBox; };
  1062. struct  FS_DnDDrop                              { LONG MouseX, MouseY; FObject *Source; };
  1063. struct  FS_RethinkLayout                        { FObject Object; };
  1064. struct  FS_BuildContextHelp                     { LONG MouseX, MouseY; STRPTR Help; };
  1065. struct  FS_BuildContextMenu                     { LONG MouseX, MouseY; FObject Menu, ContextOwner; struct FeelinRender *Render; };
  1066.  
  1067. /*** attributes ************************************************************/
  1068.  
  1069. #define FA_AreaData                             (FR_Area_ATTR +  0)
  1070. #define FA_Left                                 (FR_Area_ATTR +  1)
  1071. #define FA_Top                                  (FR_Area_ATTR +  2)
  1072. #define FA_Width                                (FR_Area_ATTR +  3)
  1073. #define FA_Height                               (FR_Area_ATTR +  4)
  1074. #define FA_Right                                (FR_Area_ATTR +  5)
  1075. #define FA_Bottom                               (FR_Area_ATTR +  6)
  1076. #define FA_Inner_Left                           (FR_Area_ATTR +  7)
  1077. #define FA_Inner_Top                            (FR_Area_ATTR +  8)
  1078. #define FA_Inner_Right                          (FR_Area_ATTR +  9)
  1079. #define FA_Inner_Bottom                         (FR_Area_ATTR + 10)
  1080. #define FA_Inner_Width                          (FR_Area_ATTR + 11)
  1081. #define FA_Inner_Height                         (FR_Area_ATTR + 12)
  1082. #define FA_MinWidth                             (FR_Area_ATTR + 13)
  1083. #define FA_MinHeight                            (FR_Area_ATTR + 14)
  1084. #define FA_MaxWidth                             (FR_Area_ATTR + 15)
  1085. #define FA_MaxHeight                            (FR_Area_ATTR + 16)
  1086. #define FA_FixWidth                             (FR_Area_ATTR + 17)
  1087. #define FA_FixHeight                            (FR_Area_ATTR + 18)
  1088. #define OBS_FA_FixWidthTxt                          (FR_Area_ATTR + 19) // deprecated
  1089. #define OBS_FA_FixHeightTxt                         (FR_Area_ATTR + 20) // deprecated
  1090. #define OBS_FA_Fixed                                (FR_Area_ATTR + 21) // deprecated , use FA_SetMin,TRUE, FA_SetMax,TRUE
  1091. #define OBS_FA_FixedWidth                           (FR_Area_ATTR + 22) // deprecated , use FA_SetMin,FV_SetMinW, FA_SetMax,FV_SetMaxW
  1092. #define OBS_FA_FixedHeight                          (FR_Area_ATTR + 23) // deprecated , use FA_SetMin,FV_SetMinH, FA_SetMax,FV_SetMaxH
  1093. #define FA_SetMin                               (FR_Area_ATTR + 24)
  1094. #define FA_SetMax                               (FR_Area_ATTR + 25)
  1095. #define FA_Active                               (FR_Area_ATTR + 26)
  1096. #define FA_Selected                             (FR_Area_ATTR + 27)
  1097. #define FA_Pressed                              (FR_Area_ATTR + 28)
  1098. #define FA_Hidden                               (FR_Area_ATTR + 29)
  1099. #define FA_Disabled                             (FR_Area_ATTR + 30)
  1100. #define FA_Draggable                            (FR_Area_ATTR + 31)
  1101. #define FA_Dropable                             (FR_Area_ATTR + 32)
  1102. #define FA_Horizontal                           (FR_Area_ATTR + 33)
  1103. #define FA_Timer                                (FR_Area_ATTR + 34)
  1104. #define FA_Font                                 (FR_Area_ATTR + 35)
  1105. #define FA_Weight                               (FR_Area_ATTR + 36)
  1106. #define FA_NoFill                               (FR_Area_ATTR + 37)
  1107. #define FA_InputMode                            (FR_Area_ATTR + 38)
  1108. #define FA_ControlChar                          (FR_Area_ATTR + 39)
  1109. #define FA_ChainToCycle                         (FR_Area_ATTR + 40)
  1110. #define FA_WindowObject                         (FR_Area_ATTR + 41)
  1111.  
  1112. /*** values ****************************************************************/
  1113.  
  1114. enum    {                                       /* FM_DnDReport */
  1115.  
  1116.         FV_DnDReport_Timer,
  1117.         FV_DnDReport_Move
  1118.  
  1119.         };
  1120.  
  1121. enum    {                                       /* FA_InputMode */
  1122.  
  1123.         FV_InputMode_None,
  1124.         FV_InputMode_Immediate,
  1125.         FV_InputMode_Release,
  1126.         FV_InputMode_Toggle
  1127.  
  1128.         };
  1129.  
  1130. enum    {                                       /* FA_SetMin */
  1131.  
  1132.         FV_SetMin = TRUE,
  1133.         FV_NoSetMin,
  1134.         FV_SetMinW,
  1135.         FV_SetMinH
  1136.  
  1137.         }; 
  1138.  
  1139. enum    {                                       /* FA_SetMax */
  1140.  
  1141.         FV_SetMax = TRUE,
  1142.         FV_NoSetMax,
  1143.         FV_SetMaxW,
  1144.         FV_SetMaxH
  1145.  
  1146.         }; 
  1147.  
  1148. #define FV_Font_Inherit                         -1
  1149. #define FV_MAXMAX                               10000
  1150.  
  1151. /*** flags *****************************************************************/
  1152.  
  1153. #define FF_Horizontal                           (1L <<  0)
  1154. #define FF_Area_SetMinW                         (1L <<  1)
  1155. #define FF_Area_SetMaxW                         (1L <<  2)
  1156. #define FF_Area_SetMinH                         (1L <<  3)
  1157. #define FF_Area_SetMaxH                         (1L <<  4)
  1158. #define FF_Area_Selected                        (1L <<  5) // PRIVATE ??
  1159. #define FF_Area_Pressed                         (1L <<  6) // PRIVATE ??
  1160. #define FF_Area_Active                          (1L <<  7) // PRIVATE ??
  1161. #define FF_Area_Disabled                        (1L <<  8)
  1162.  
  1163. #define FF_Area_Group                           (1L << 12) // PRIVATE ?? This flag is set by FC_Group to recognize object as a group (only used by FM_Group_Forward)
  1164. #define FF_Area_CanDraw                         (1L << 13) // This object may be drawn
  1165. #define FF_Area_CanShow                         (1L << 14) // This object may be shown
  1166. #define FF_Area_Setup                           (1L << 15) // ?? USEFULL FM_Setup successful
  1167.  
  1168. /* FIXME: is FF_AREA_SETUP useful  ???  To  know  if  setup  succeed  check
  1169. _render. Only used by F_Draw(). */
  1170.  
  1171. /* FM_Draw flags */
  1172.  
  1173. #define FF_Draw_Object                          (1L <<  0)
  1174. #define FF_Draw_Update                          (1L <<  1)
  1175. #define FF_Draw_Custom_1                        (1L << 24)
  1176. #define FF_Draw_Custom_2                        (1L << 25)
  1177. #define FF_Draw_Custom_3                        (1L << 26)
  1178. #define FF_Draw_Custom_4                        (1L << 27)
  1179. #define FF_Draw_Custom_5                        (1L << 28)
  1180. #define FF_Draw_Custom_6                        (1L << 29)
  1181. #define FF_Draw_Custom_7                        (1L << 30)
  1182. #define FF_Draw_Custom_8                        (1L << 31)
  1183.  
  1184. /*** FM_Erase ***/
  1185.  
  1186. #define FF_Erase_Fill                           (1L <<  0) // Force area to be filled even in refresh mode
  1187. #define FF_Erase_Region                         (1L <<  1) //
  1188.  
  1189. typedef struct FeelinBox                        FBox;
  1190. typedef struct FeelinRect                       FRect;
  1191. typedef struct FeelinMinMax                     FMinMax;
  1192.  
  1193. struct FeelinBox    { WORD x,y; UWORD w,h; };
  1194. struct FeelinRect   { WORD x1,y1,x2,y2; };
  1195. struct FeelinMinMax { UWORD MinW,MinH,MaxW,MaxH; };
  1196.  
  1197. /*** FeelinAreaData ********************************************************/
  1198.  
  1199. typedef struct FeelinAreaData                   FAreaData;
  1200.  
  1201. struct FeelinAreaData
  1202. {
  1203.     FObject                         Parent;         // FA_Parent
  1204.     FObject                         Next;
  1205.     FObject                         Prev;
  1206.  
  1207.     FRender                        *Render;         // FC_Render object
  1208.     ULONG                           Flags;
  1209.  
  1210.     FBox                            Box;
  1211.     FInner                          Inner;
  1212.     FMinMax                         MinMax;
  1213.  
  1214.     ULONG                          *Pens;
  1215.     struct TextFont                *Font;
  1216.     UWORD                           Weight;
  1217. };
  1218.  
  1219. /* the following macros assume  the  variable  'LOD'  to  be  declared  and
  1220. holding  a  field  'AreaData'  of type (FAreaData *). If it is not the case
  1221. undef '_areadata' and redefine it to your convenience */
  1222.  
  1223. #define _init_areadata  LOD -> AreaData = (FAreaData *) F_Get(Obj,FA_AreaData)
  1224. #define _areadata       ((FAreaData *)(LOD -> AreaData))
  1225. #define _parent         (_areadata -> Parent)
  1226. #define _next           (_areadata -> Next)
  1227. #define _prev           (_areadata -> Prev)
  1228. #define _render         (_areadata -> Render)
  1229. #define _flags          (_areadata -> Flags)
  1230. #define _box            (_areadata -> Box)
  1231. #define _x              (_box.x)
  1232. #define _y              (_box.y)
  1233. #define _w              (_box.w)
  1234. #define _h              (_box.h)
  1235. #define _inner          (_areadata -> Inner)
  1236. #define _bl             (_inner.l)
  1237. #define _bt             (_inner.t)
  1238. #define _br             (_inner.r)
  1239. #define _bb             (_inner.b)
  1240. #define _minmax         (_areadata -> MinMax)
  1241. #define _minw           (_minmax.MinW)
  1242. #define _minh           (_minmax.MinH)
  1243. #define _maxw           (_minmax.MaxW)
  1244. #define _maxh           (_minmax.MaxH)
  1245. #define _pens           (_areadata -> Pens)
  1246. #define _font           (_areadata -> Font)
  1247. #define _weight         (_areadata -> Weight)
  1248.  
  1249. /* extanded coordinates macros */
  1250.  
  1251. #define _x2             (_x + _w - 1)
  1252. #define _y2             (_y + _h - 1)
  1253. #define _mx             (_x + _bl)
  1254. #define _my             (_y + _bt)
  1255. #define _mw             (_w - _bl - _br)
  1256. #define _mh             (_h - _bt - _bb)
  1257. #define _mx2            (_x2 - _br)
  1258. #define _my2            (_y2 - _bb)
  1259.  
  1260. /* macros to access  "_areadata.render".  !!WARNING!!  "_render"  *MUST*  be
  1261. checked before accessing flieds */
  1262.  
  1263. #define _display        (_render -> Display)
  1264. #define _app            (_render -> Application)
  1265. #define _win            (_render -> Window)
  1266. #define _rp             (_render -> RPort)
  1267.  
  1268. /* macros that can be used while creating objects */
  1269.  
  1270. #define AreaObject                              F_NewObj(FC_Area
  1271. #define InputImmediate                          FA_InputMode,FV_InputMode_Immediate
  1272. #define InputRelease                            FA_InputMode,FV_InputMode_Release
  1273. #define InputToggle                             FA_InputMode,FV_InputMode_Toggle
  1274. #define DontChain                               FA_ChainToCycle,FALSE
  1275. #define HorizLayout                             FA_Horizontal,TRUE
  1276. //+
  1277. /// Group                              0x001040
  1278. #define FR_Group                                  0x001040
  1279. #define FR_Group_MTHD                           (MTHD_BASE | FR_Group)
  1280. #define FR_Group_ATTR                           (ATTR_BASE | FR_Group)
  1281. #define FC_Group                                               "Group"
  1282.  
  1283. #define FM_Group_Forward                        (FR_Group_MTHD +  0)
  1284. #define FM_Group_InitChange                     (FR_Group_MTHD +  1)
  1285. #define FM_Group_ExitChange                     (FR_Group_MTHD +  2)
  1286.  
  1287. #define FA_Group_HSpacing                       (FR_Group_ATTR +  0)
  1288. #define FA_Group_VSpacing                       (FR_Group_ATTR +  1)
  1289. #define FA_Group_SameWidth                      (FR_Group_ATTR +  2)
  1290. #define FA_Group_SameHeight                     (FR_Group_ATTR +  3)
  1291. #define FA_Group_SameSize                       (FR_Group_ATTR +  4)
  1292. #define FA_Group_RelSizing                      (FR_Group_ATTR +  5)
  1293. #define FA_Group_Title                          (FR_Group_ATTR +  6)
  1294. #define FA_Group_Forward                        (FR_Group_ATTR +  7)
  1295. #define FA_Group_PageMode                       (FR_Group_ATTR +  8)
  1296. #define FA_Group_PageFont                       (FR_Group_ATTR +  9)
  1297. #define FA_Group_PageStyle                      (FR_Group_ATTR + 10)
  1298. #define FA_Group_ActivePage                     (FR_Group_ATTR + 11)
  1299. #define FA_Group_Rows                           (FR_Group_ATTR + 12)
  1300. #define FA_Group_Columns                        (FR_Group_ATTR + 13)
  1301. #define FA_Group_LayoutHook                     (FR_Group_ATTR + 14)
  1302. #define FA_Group_MinMaxHook                     (FR_Group_ATTR + 15)
  1303. #define FA_Group_Head                           (FR_Group_ATTR + 16)
  1304. #define FA_Group_Tail                           (FR_Group_ATTR + 17)
  1305.  
  1306. #define FA_Group_BufferRegion                   (FR_Group_ATTR + 20) // PRIVATE
  1307.  
  1308. enum    {
  1309.  
  1310.         FV_Group_ActivePage_Prev = -3,
  1311.         FV_Group_ActivePage_Next,
  1312.         FV_Group_ActivePage_Last,
  1313.         FV_Group_ActivePage_First
  1314.  
  1315.         };
  1316.  
  1317. #define GroupObject                             F_NewObj(FC_Group
  1318. #define VGroup                                  F_NewObj(FC_Group,FA_ChainToCycle,FALSE
  1319. #define HGroup                                  F_NewObj(FC_Group,FA_ChainToCycle,FALSE,FA_Horizontal,TRUE
  1320. #define RowGroup(x)                             F_NewObj(FC_Group,FA_ChainToCycle,FALSE,FA_Group_Rows,x
  1321. #define ColGroup(x)                             F_NewObj(FC_Group,FA_ChainToCycle,FALSE,FA_Group_Columns,x
  1322. #define Page                                    F_NewObj(FC_Group,FA_Group_PageMode,TRUE
  1323. //+
  1324. ///Text                               0x001080
  1325. #define FR_Text                                   0x001080
  1326. #define FR_Text_MTHD                            (MTHD_BASE | FR_Text)
  1327. #define FR_Text_ATTR                            (ATTR_BASE | FR_Text)
  1328. #define FC_Text                                                "Text"
  1329.  
  1330. #define FA_Text                                 (FR_Text_ATTR +  0)
  1331. #define FA_Text_PreParse                        (FR_Text_ATTR +  1)
  1332. #define FA_Text_AltPreParse                     (FR_Text_ATTR +  2)
  1333. #define FA_Text_Shortcut                        (FR_Text_ATTR +  3)
  1334. #define FA_Text_HCenter                         (FR_Text_ATTR +  4)
  1335. #define FA_Text_VCenter                         (FR_Text_ATTR +  5)
  1336. #define FA_Text_Static                          (FR_Text_ATTR +  6)
  1337.  
  1338. #define TextObject                              F_NewObj(FC_Text
  1339. #define TextBack                                FA_Back, "FP_Text_Back"
  1340. //+
  1341.  
  1342. /***************************************************************************/
  1343. /*** Dynamic Classes *******************************************************/
  1344. /***************************************************************************/
  1345.  
  1346. #define FC_AdjustColor              "AdjustColor"
  1347. #define FC_AdjustFrame              "AdjustFrame"
  1348. #define FC_AdjustImage              "AdjustImage"
  1349. #define FC_AdjustScheme             "AdjustScheme"
  1350. #define FC_Balance                  "Balance"    // SUPER: FC_Area
  1351. #define FC_Bar                      "Bar"        // SUPER: FC_Area
  1352. #define FC_Cycle                    "Cycle"              // SUPER: FC_Group
  1353. #define FC_Dataspace                "Dataspace"
  1354. #define FC_Decorator                "Decorator"
  1355. #define FC_Display                  "Display"
  1356. #define FC_DOSNotify                "DOSNotify"
  1357. #define FC_Gauge                    "Gauge"      // SUPER: FC_Numeric
  1358. #define FC_Image                    "Image"      // SUPER: FC_Area
  1359. #define FC_List                     "List"
  1360. #define FC_Numeric                  "Numeric"    // SUPER: FC_Area
  1361. #define FC_Picture                  "Picture"
  1362. #define FC_PopColor                 "PopColor"
  1363. #define FC_PopFrame                 "PopFrame"
  1364. #define FC_PopHelp                  "PopHelp"
  1365. #define FC_PopImage                 "PopImage"
  1366. #define FC_PopScheme                "PopScheme"
  1367. #define FC_Preference               "Preference"
  1368. #define FC_PreferenceEditor         "PreferenceEditor"
  1369. #define FC_PreferenceGroup          "PreferenceGroup"
  1370. #define FC_PreviewColor             "PreviewColor"
  1371. #define FC_PreviewFrame             "PreviewFrame"
  1372. #define FC_PreviewScheme            "PreviewScheme"
  1373. #define FC_Prop                     "Prop"       // SUPER: FC_Area
  1374. #define FC_Radio                    "Radio"
  1375. #define FC_Slider                   "Slider"     // SUPER: FC_Numeric
  1376. #define FC_String                   "String"     // SUPER: FC_Area
  1377.  
  1378. #define AdjustColorObject           F_NewObj(FC_AdjustColor
  1379. #define AdjustFrameObject           F_NewObj(FC_AdjustFrame
  1380. #define AdjustImageObject           F_NewObj(FC_AdjustImage
  1381. #define AdjustSchemeObject          F_NewObj(FC_AdjustScheme
  1382. #define BalanceObject               F_NewObj(FC_Balance
  1383. #define BalanceID(id)               F_NewObj(FC_Balance,FA_ID,id,TAG_DONE)
  1384. #define BarObject                   F_NewObj(FC_Bar
  1385. #define CycleObject                 F_NewObj(FC_Cycle
  1386. #define DataspaceObject             F_NewObj(FC_Dataspace
  1387. #define DecoratorObject             F_NewObj(FC_Decorator
  1388. #define DOSNotifyObject             F_NewObj(FC_DOSNotify
  1389. #define GaugeObject                 F_NewObj(FC_Gauge
  1390. #define ImageObject                 F_NewObj(FC_Image
  1391. #define NumericObject               F_NewObj(FC_Numeric
  1392. #define PictureObject               F_NewObj(FC_Picture
  1393. #define PopColorObject              F_NewObj(FC_PopColor
  1394. #define PopFrameObject              F_NewObj(FC_PopFrame
  1395. #define PopHelpObject               F_NewObj(FC_PopHelp
  1396. #define PopImageObject              F_NewObj(FC_PopImage
  1397. #define PopSchemeObject             F_NewObj(FC_PopScheme
  1398. #define PreviewColorObject          F_NewObj(FC_PreviewColor
  1399. #define PreviewFrameObject          F_NewObj(FC_PreviewFrame
  1400. #define PreviewSchemeObject         F_NewObj(FC_PreviewScheme
  1401. #define PropObject                  F_NewObj(FC_Prop
  1402. #define RadioObject                 F_NewObj(FC_Radio
  1403. #define SliderObject                F_NewObj(FC_Slider
  1404. #define StringObject                F_NewObj(FC_String
  1405.  
  1406. /***************************************************************************/
  1407. /*** Method Messages *******************************************************/
  1408. /***************************************************************************/
  1409.  
  1410. struct  FS_Dataspace_Add                        { APTR Data; ULONG Size; ULONG ID; };
  1411. struct  FS_Dataspace_Remove                     { ULONG ID; };
  1412. struct  FS_Dataspace_Find                       { ULONG ID; };
  1413. struct  FS_Dataspace_Resolve                    { ULONG ID; ULONG *Save; };
  1414. struct  FS_Dataspace_WriteIFF                   { struct IFFHandle *IFF; ULONG Type; ULONG ID; };
  1415. struct  FS_Dataspace_ReadIFF                    { struct IFFHandle *IFF; };
  1416. struct  FS_DOSNotify_Notify                     { FObject DNObject; STRPTR FileName; };
  1417. struct  FS_Picture_Draw                         { struct FeelinRender *Render; struct FeelinRect *Rect; ULONG Flags; };
  1418. struct  FS_Prop_Decrease                        { LONG Value; };
  1419. struct  FS_Prop_Increase                        { LONG Value; };
  1420. struct  FS_Preference_Find                      { STRPTR Name; };
  1421. struct  FS_Preference_Add                       { STRPTR Name; APTR Data; ULONG Size; };
  1422. struct  FS_Preference_AddLong                   { STRPTR Name; ULONG Data; };
  1423. struct  FS_Preference_AddString                 { STRPTR Name; STRPTR Data; };
  1424. struct  FS_Preference_Remove                    { STRPTR Name; };
  1425. struct  FS_Preference_Read                      { STRPTR Name; };
  1426. struct  FS_Preference_Write                     { STRPTR Name; };
  1427. struct  FS_Preference_Resolve                   { STRPTR Name; APTR Default; };
  1428. struct  FS_Preference_ResolveInt                { STRPTR Name; ULONG Default; };
  1429. struct  FS_PreferenceGroup_Load                 { FObject Prefs; ULONG id_Resolve; ULONG id_ResolveInt; };
  1430. struct  FS_PreferenceGroup_Save                 { FObject Prefs; ULONG id_Add; ULONG id_AddLong; ULONG id_AddString; };
  1431.  
  1432. struct  FS_Numeric_Increase                     { LONG Value; };
  1433. struct  FS_Numeric_Decrease                     { LONG Value; };
  1434. struct  FS_Numeric_Stringify                    { LONG Value; };
  1435.  
  1436. /***************************************************************************/
  1437. /*** Values ****************************************************************/
  1438. /***************************************************************************/
  1439.  
  1440. enum    {
  1441.  
  1442.         FV_Image_Normal,
  1443.         FV_Image_Selected,
  1444.         FV_Image_Enabled,
  1445.         FV_Image_Disabled
  1446.  
  1447.         };
  1448.  
  1449. enum    {
  1450.  
  1451.         FV_Cycle_Prev = -3,
  1452.         FV_Cycle_Next,
  1453.         FV_Cycle_Last,
  1454.         FV_Cycle_First
  1455.  
  1456.         };
  1457.  
  1458. enum    {
  1459.  
  1460.         FV_Preference_ENV = -3,
  1461.         FV_Preference_ENVARC,
  1462.         FV_Preference_BOTH
  1463.  
  1464.         };
  1465.  
  1466. enum    {
  1467.  
  1468.         FV_String_Left,
  1469.         FV_String_Center,
  1470.         FV_String_Right
  1471.  
  1472.         };
  1473.  
  1474. #endif
  1475.